/* 更改管理员密码那题：
模拟实现用户密码管理：输入旧的用户名和密码，如果正确，方有权限更新；从键盘获取新的密码，进行更新*/
package ZUOYE0428;

import java.util.Scanner;

public class AdminShow {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		Admin test = new Admin();
		while (true) {
			System.out.print("请输入用户名：");
			String Name = in.next();
			System.out.print("请输入密码：");
			int password = in.nextInt();
			System.out.println();
			if (Name.equals(test.name) && password == test.password) {
				System.out.print("请输入新密码：");
				int newpassword = in.nextInt();
				test.password = newpassword;
				test.show();
				break;
			}
			System.out.println("密码输入错误，请重新输入");

		}

	}

}
